package com.feri.ssm.controller;

import com.feri.ssm.entity.Admin;
import com.feri.ssm.service.impl.AdminServiceImpl;
import com.feri.ssm.service.intf.AdminService;
import com.feri.ssm.vo.R;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/after/")
public class AdminController {
    @Resource
    private AdminService service;
    //登录功能
    @PostMapping("login.do")
    public String login(String name, String password, Model model) {
        System.out.println("登录信息"+name+password);
        service.login(name, password);
        model.addAttribute("msg","登录成功");
        return "success";
    }
}
